Skip to content

Conversation

dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented May 26, 2025

What changes were proposed in this pull request?

This PR aims to identify InvalidTypeException in SparkConnectClient.

Why are the changes needed?

To centralize the InvalidTypeException handling into a single place. Previously, three actors do the same error handling logic redundantly.

  • DataFrame
  • DataFrameReader
  • DataStreamReader

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Pass the CIs.

Was this patch authored or co-authored using generative AI tooling?

No.

@dongjoon-hyun
Copy link
Member Author

cc @viirya

return response.ddlParse.parsed
} catch let error as RPCError where error.code == .internalError {
switch error.message {
case let m where m.contains("UNSUPPORTED_DATATYPE") || m.contains("INVALID_IDENTIFIER"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is INVALID_IDENTIFIER only for invalid type? It sounds like also for any identifier that could be others?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. This is only for ddlParse. Okay.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm currently mapping the internal error to SparkConnectError by finding the details.

I can make INVALID_IDENTIFIER to the official one of SparkConnectError when I collect more instances.

@dongjoon-hyun
Copy link
Member Author

Thank you, @viirya . Merged to main.

@dongjoon-hyun dongjoon-hyun deleted the SPARK-52317 branch May 27, 2025 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants